package com.zbkj.crmeb.task.order;


import com.alibaba.fastjson.JSON;
import com.zbkj.crmeb.store.service.CommonTradeService;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import com.xxl.job.core.handler.annotation.XxlJob;
import com.zbkj.crmeb.store.service.JkyTradeService;
import com.zbkj.crmeb.store.service.impl.StoreOrderServiceImpl;

/**
 * 订单物流查询
 * @author daigb
 * @date:  2022-04-11 16:34
 */
@Component
@Configuration
public class OrderTradeTask implements ApplicationRunner {
    @Autowired
    private JkyTradeService jkyTradeService;
    @Autowired
	@Qualifier(value = "kaiCangTradeServiceImpl")
    private CommonTradeService kaiCangTradeService;
	@Autowired
	@Qualifier(value = "commonStoreTradeServiceImpl")
	private CommonTradeService commonTradeService;
	@Autowired
	@Qualifier(value = "directStoreTradeServiceImpl")
	private CommonTradeService directTradeService;
	private static final Logger logger = LoggerFactory.getLogger(OrderTradeTask.class);

	/**
     * 吉客云订单物流查询
     * @author daigb
     * @date:  2023-01-04 10:46
     */
	@XxlJob("jkyOrderTradeTask")
//	@Scheduled(fixedDelay = 1000 * 60 * 10 )
    public void jkyOrderTradeTask(){
		jkyTradeService.tradeFullinfoget();
    }
	
	/**
	 * 温州保税仓订单物流查询
	 * @author daigb
	 * @date:  2023-01-04 10:46
	 */
	@XxlJob("kaiCangOrderTradeTask")
	public void kaiCangOrderTradeTask(){
		logger.info("kaiCangOrderTradeTask");

		kaiCangTradeService.tradeFullinfoget();
	}

	/**
	 * 温州保税仓订单物流查询
	 * @author daigb
	 * @date:  2023-01-04 10:46
	 */
	@XxlJob("commonOrderTradeTask")
	public void CommonStoreOrderTradeTask(){
		logger.info("CommonStoreOrderTradeTask");

		commonTradeService.tradeFullinfoget();
	}

	@XxlJob("directStoreTradeServiceImpl")
	public void DirectStoreOrderTradeTask(){
		directTradeService.tradeFullinfoget();
	}

	@Override
	public void run(ApplicationArguments args) throws Exception {
//		DirectStoreOrderTradeTask();
//		CommonStoreOrderTradeTask();
	}
}
